home *** CD-ROM | disk | FTP | other *** search
/ Utilities Professional 1-1500 / Utilities Professional 1-1500 (1994)(WPD)[!].iso / 12511500 / var1268.dms / var1268.adf / MapStation.doc < prev    next >
Text File  |  1992-09-02  |  28KB  |  700 lines

  1. --PRESS ESCAPE TO EXIT--       -------------------------------
  2.                                MAP-STATION V1.02 DOCUMENTATION
  3.                                -------------------------------
  4. -------------------
  5. -- Starting note --
  6. -------------------
  7.  
  8.    This is the complete documentation for the program.  A simple on-line
  9. help is available within the program by pressing [HELP] on the keyboard.
  10. This help is available at all times except when a file requester or the
  11. icon bar is displayed.
  12.  
  13. -----------------------------
  14. -- Purpose of this program --
  15. -----------------------------
  16.  
  17.    This program is a game level-map editor which I have produced to aid me
  18. in designing the levels for a game I am currently in the process of
  19. developing in assembly language.  
  20.    The way a level is made up is out of a collection of graphical
  21. blocks which can vary in size (usually 16x16 or 32x32 pixels).  When the
  22. blocks are originally created within a paint program they are drawn so that
  23. they will fit together to make larger objects.  If done properly a level of
  24. a game can take up considerably less memory than having the level made out of
  25. one big picture (which if the level was of a reasonable size would be
  26. larger than available memory as a single 320*256 32 colour screen eats up
  27. over 50k alone) and can look just as good.
  28.     Without a map editor it can be a real chore designing a level in any
  29. programming language because the block numbers have to be typed in by hand as
  30. data statements (BASIC), dc statements (ASSEMBLY) etc.  This can be a
  31. laborious process especially if the level is quite big and also you don`t
  32. instantly know what the level is going to look like.
  33.     A map editor allows you to select a block from the amount available and
  34. using the mouse paste it onto the level map at any position.  This way you
  35. can see straight away what the level is going to look like when it is in
  36. the actual game and any mistakes can be corrected or changes can easily be 
  37. made.  As more blocks are drawn they can easily be added to the list available
  38. for use within the level.
  39.  
  40.  
  41. --------------------------
  42. -- Usage of the program --
  43. --------------------------
  44.  
  45.    This editor can be controlled using a combination of icons and keyboard
  46. presses.  Some functions are available using both while others are only
  47. available using one or the other.  The map editor has five separate modes
  48. which have their own screen and some functions are only selectable when on
  49. the particular screen related to the function. The five modes are:
  50.  
  51.  
  52. Block cut - Used for cutting blocks from an IFF picture
  53.  
  54. Block select - Used for selecting which block to paste onto the map
  55.  
  56. Block edit - Used for editing existing blocks and making new blocks
  57.  
  58. Map edit - Used for pasting blocks onto the map and removing blocks
  59.  
  60. Cut-Buffer mode - Used for grabbing chunks of the map or for creating
  61.                   chunks to paste onto the map
  62.  
  63. The menu is activated by moving the mouse to the top of the screen and
  64. pressing the right mouse button.  The menu bar will then glide to the top
  65. of the screen and an option can be selected or you can remove the menu (by
  66. pressing the right mouse button again - with the mouse at the top of the
  67. screen).  At this point the menu will then glide off the bottom of the
  68. screen.
  69.  
  70. The menu options are:
  71.  
  72. Row one
  73. -------
  74.  
  75. 1.  Load IFF - Loads an iff picture for cutting blocks from (only in Block
  76.     cut mode).
  77. 2.  Load Level - Loads a complete level into level bank (Palette, Blocks,
  78.     Map).
  79. 3.  Save Level - Saves complete level from level bank (Palette, Blocks,
  80.     Map).
  81. 4.  Load Blocks - Loads new blocks into bank.
  82. 5.  Save Blocks - Saves current blocks from bank.
  83. 6.  Load Map - Loads new map into bank.
  84. 7.  Save Map - Saves current map from bank.
  85. 8.  Clear Blocks - Clears blocks from bank.
  86. 9.  Clear Map - Clears map from bank.
  87. 10. Exit program - Does just that.
  88.  
  89.  
  90. Row two
  91. -------
  92.  
  93. 1.  Block Cut - Enter Block-Cut mode.
  94. 2.  Block Select - Enter Block-Select mode.
  95. 3.  No option.
  96. 4.  Block Editor - Enters Block-Edit mode.
  97. 5.  No option.
  98. 6.  No option.
  99. 7.  No option.
  100. 8.  No option.
  101. 9.  Map Editor - Enters Map-Edit mode.
  102. 10. No option.
  103.  
  104.  
  105. Row three
  106. ---------
  107.  
  108. 1.  Store Block - Stores selected block from block-cut screen.
  109. 2.  Merge Blocks - Merges two blocks (One over the other).
  110. 3.  Set no. of Blocks - Set number of blocks available.
  111. 4.  Block X-Flip - Flips edit block horizontally.
  112. 5.  Block Y-Flip - Flips edit block vertically.
  113. 6.  Block Insert - Inserts edit block into bank.
  114. 7.  Block Replace - Replaces block in bank with edit block.
  115. 8.  Erase Block - Clears block from block edit screen.
  116. 9.  Set Map Dimensions - Set new height and width of map (Block-Edit mode).
  117. 10. No option.
  118.  
  119.  
  120. Available in all modes
  121. ----------------------
  122.  
  123. Load entire level - Select the "Load Level" icon (Row 1, Column 2) to load
  124.                     Palette data, Map data and Block data together.
  125.  
  126. Save entire level - Select the "Save Level" icon (Row 1, Column 3) to save
  127.                     Palette data, Map data and Block data together.
  128.  
  129.  
  130. Block cut mode
  131. --------------
  132.  
  133. Load IFF - Select the "Load IFF" icon (Row 1, Column 1) to load an IFF
  134.            picture from which to cut blocks from.
  135.  
  136. Cut Block - The block to be cut out is outlined using a 16x16 box which is
  137. moved around with the mouse.  The left mouse button is then pressed to lock the
  138. box onto the block.  To grab the block either call up the menu and click the
  139. "Store" icon (Row 3, Column 1) or press the [G]rab key.  The display will then
  140. momentarily flip to the Block select screen where you store the block by
  141. clicking with the left mouse button on the place you want it to go.  After
  142. this has been done you will return to the Block cut screen.  To release the
  143. box again press the right mouse button.
  144.  
  145.  
  146. Block select mode
  147. -----------------
  148.  
  149. Load Blocks - Select the "Load Blocks" icon (Row 1, Column 4) and then
  150.               select the name of the block screen to load using a file
  151.               requester.
  152.  
  153. Save Blocks - Select the "Save Blocks" icon (Row 1, Column 5) and select
  154.               the name of the block screen to save using a file requester.
  155.  
  156. Delete Blocks - Select the "Delete Blocks" icon (Row 1, Column 8).
  157.  
  158. Merge 2 blocks - Select the Merge Blocks" icon (Row 3, Column 2) and click
  159.                 the left mouse button on the block to use as the background
  160.                 and the right mouse button on the block to use as the
  161.                 foreground the click the left mouse button on the place to
  162.                 store the block.
  163.  
  164.         N.B Any pixels with are set to the background colour
  165.                     (colour 0) on the foreground block will show through
  166.                     the background block.
  167.  
  168. Select block for map - Click the left mouse button on a block.
  169.  
  170. Select block for edit - Click the right mouse button on a block.
  171.  
  172. Grab block from edit screen - Press F9
  173.  
  174. Scroll blocks up or down - Cursor Up/Down
  175.  
  176. Change no. of blocks available - Select the "No. Blocks" icon (Row 3,Column 3)
  177.                          You are then able to change the number of
  178.                  blocks available on the info bar at the
  179.                                  top of the screen. The value you enter
  180.                                  will be scaled to the nearest 20. If you
  181.                      the value you enter will be changed to 320
  182.                  if it is less than this as 320 is the
  183.                  minimum number of blocks allowed.
  184.  
  185. Block edit mode
  186. ---------------
  187.  
  188. Plot a pixel - Position the mouse pointer on the place you require in the
  189.                expanded box and click the left mouse button.
  190.  
  191. Clear a pixel - Position the mouse pointer on the place you require in the
  192.                 expanded box and click the right mouse button.
  193.  
  194. Area fill - Position the mouse pointer on the area to fill and press
  195.             [Space].
  196.           
  197. Change map dimensions - Select the "Map Dimensions" icon (Row 3, Column 9)
  198.                         then type in the map width and press and then the map
  199.                         height and press [Return].  The current map will then
  200.                         be cleared and the new map size will be set.
  201.             N.B.  If the size you specify for the map exceeds
  202.                               the amount of available level bank memory
  203.                               then you will need to re-enter the map
  204.                               dimensions.
  205.  
  206.                   The minimum map dimensions are 20x16. If the
  207.                   values entered are any less than this they
  208.                   are replaced with these values instead.
  209.  
  210. Flip block horizontally - Select "Flip-X" icon (Row 3, Column 4) or press
  211.                           [X] on the keyboard.
  212.  
  213. Flip block vertically - Select "Flip-Y" icon (Row 3, Column 5) or press [Y]
  214.             on the keyboard.
  215.  
  216. Insert block - Select the "Insert Block" icon (Row 3, Column 6).  The Block
  217.                select screen will be displayed where you click the left mouse
  218.            button on the position to insert the block after which you return
  219.                to the Block edit screen.
  220.  
  221. Replace block - Select the "Replace Block" icon (Row 3, Column 7).  The block in
  222.                 the edit window will then replace the original.
  223.  
  224. Clear block - Select the "Clear Block" icon (Row 3, Column 8).  The edit window
  225.           will then be cleared.  This function doesn't affect the actual 
  226.               block data - to actually clear the block perform a replace after
  227.               this function (See previous function).
  228.  
  229. Generate mask for block - Press the "G" key. This will generate a collision
  230.               mask for the block which will then be displayed in the right-
  231.           hand window.  This can be edited in the same way as the block
  232.               data except that left-mouse=colour 1 and right-mouse=colour 0.
  233.  
  234. Change current ink colour - This decides which colour to fill or plot a
  235.                             pixel with.  To change the colour click the
  236.                             left mouse button on one of the 32 different colour
  237.                             boxes at the bottom of the screen.  To show
  238.                             which colour is currently selected there is 
  239.                             a bar going across the top of the colour boxes.
  240.  
  241. Change a colour in the palette - Select a colour to change and then alter
  242.                                  the Red, Green and Blue values adjusting the 3
  243.                                  slider bars on the screen until the desired
  244.                                  colour is obtained.
  245.  
  246. Draw a line - Press the "L" key to initiate, then hold down the left mouse
  247.               button to set the first point and whilst keeping the button
  248.               held down move the mouse to the desired position for the 
  249.               second point and release the mouse button. To cancel the line
  250.           press the right mouse button while positioning the second
  251.               point and the screen will be restored. After the line has been
  252.           drawn you are returned to pixel mode.
  253.  
  254.  
  255. Map edit mode
  256. -------------
  257.  
  258. Load a new map - Select the "Load Map" icon (Row 1, Column 6) and then
  259.                  select the name of the map to load using the file
  260.                  requester.  The map will be loaded and the size of the map
  261.                  will be taken from the 8 byte header.
  262.  
  263. Save current map - Select the "Save Map" icon (Row 1, Column 7) and then
  264.                    select the name of the map to save using the file 
  265.                    requester.  The map will be saved along with an 8 byte
  266.                    header which contains the height and width of the map.
  267.  
  268. Clear current map - Select the "Clear Map" icon (Row 1, Column 9) and the
  269.                     map will then be erased from the screen and memory.
  270.                     The map will also be cleared if you change its size
  271.                     (See above).
  272.  
  273. Paste a block - Move the mouse pointer to the desired position and press
  274.                 the left button.
  275.  
  276. Clear a block - Move the mouse pointer to the desired position and press
  277.                 the right button.
  278.  
  279. Pick up a block to use from the map - Move the mouse pointer to the desired
  280.                                       block and then press the space bar.
  281.                                       The block under the mouse will then
  282.                                       become the current block.
  283.  
  284. Scroll map right - If the size of the map allows it and you are not at the
  285.                    right-most position press the right cursor key and the
  286.                    map will scroll 1 block right.
  287.  
  288. Scroll map left - If the size of the map allows it and you are not at the
  289.                   left-most position press the left cursor key and the
  290.                   map will scroll 1 block left.
  291.  
  292. Scroll map down - If the size of the map allows it and you are not at the
  293.                   down-most position press the down cursor key and the
  294.                   map will scroll 1 block down.
  295.  
  296. Scroll map up - If the size of the map allows it and you are not at the
  297.                 up-most position press the up cursor key and the
  298.                 map will scroll 1 block up.
  299.  
  300. Set status bits at map pos - Move mouse to required block on map and press
  301. (See later section)          keys [1] - [7] on main keyboard.  That block
  302.                              will then be outlined and the status bit will
  303.                              be set. Only those bits which are available
  304.                  can be set and this depends on the no. of
  305.                  blocks set up.
  306.  
  307. Clear all status bits from map pos - Move mouse to required position and press
  308. (See later section)                   [DEL] on the keyboard.  All outlines and
  309.                                      status bits will be cleared.
  310.  
  311. See status bits set on block - Move mouse to required block.  The state
  312. (See later section)            (0/1) of the available bits will be shown
  313.                                on the bar at the top of the screen (next to 
  314.                                screen x and y positions).
  315.                     
  316. ---- If chunk has been grabbed ----
  317.  
  318. (If chunk is grabbed the size of the chunk is indicated by a different
  319. mouse pointer showing top and bottom corner positions and the mouse buttons
  320. react differently)
  321.  
  322. Paste chunk to map - Press left mouse button at required position.
  323.  
  324. Clear area the size of chunk - Press right mouse button at required
  325.                                position.
  326.  
  327. Cancel chunk paste mode - Press both mouse buttons together.
  328.  
  329.  
  330. Cut-Buffer mode
  331. ---------------
  332.  
  333. Enter cut-buffer mode - Press the "B" key.
  334.  
  335. Create a chunk to paste onto map - Select blocks from the block screen and
  336.                                    paste them down onto the cut-buffer
  337.                                    screen with the left mouse button
  338.                            (Right mouse - Clear block,Space - Grab
  339.                                     block from cut-buffer screen).
  340.  
  341. Grab chunk from cut-buffer screen - Press the "Return" key (Main keyboard)
  342.                                     to initiate function. Press left mouse
  343.                                     button on top left corner, keep button
  344.                                     down and move mouse to bottom right
  345.                                     corner then release button.
  346.  
  347. Grab chunk from map screen - Press the "Enter" key (Keypad) to initiate
  348.                              function. Grab chunk in the same way as if
  349.                              from cut-buffer screen. 
  350.  
  351.  
  352. ---------------------------
  353. -- Technical information --
  354. ---------------------------
  355.  
  356. Assembly language fundamentals required to use level data properly
  357. ==================================================================
  358.     In Basic and most other high-level languages memory is treated in
  359. the form of variables and arrays which is all the user needs to be
  360. concerned about to do anything. In machine code however memory is treated in the 
  361. form of memory addresses which can be accessed in three different ways
  362. depending on the maximum value required to be stored. These sizes are
  363. called bytes, words and longwords. A byte is a single element in memory in
  364. which a single AscII character eg. "D" can be stored (1k = 1024 bytes, 1
  365. meg = 1024k = 1048576 bytes). A byte can store a number between the range
  366. of 0-255. As you can imagine this is not enough for most purposes so other
  367. sizes are available (Words and Longwords). A word is two bytes and can
  368. store a value between 0-65535. A longword is two words (four bytes) and can
  369. store a value between 0-4294967295.
  370.  
  371.     The map data in case you weren't sure doesn't actually contain the
  372. graphic data for every block but instead contains a number which relates to
  373. the corresponding block in the graphics set. I was originally storing each
  374. block number in a byte but this restricted the amount of blocks that could
  375. be used to a maximum of 255 so instead I decided to store each number in a
  376. word (Max. value of 65535). This was more than enough (A longword would
  377. have been over-extravagant and uneccessary). 
  378.  
  379.     I will now explain another fundamental concerning memory systems.
  380. Decimal is called base 10 (Because there are ten values in the numbering system 
  381. - 0-9). Computers don't work with decimal but instead use two other numbering 
  382. systems called Binary and Hexa-Decimal. Binary is called Base 2 and values can 
  383. be either 0 or 1. Hexa-Decimal is called Base 16 and there is a maximum of 
  384. sixteen values (To make up the extra 6 values the first 6 letters of the alphabet
  385. are used - A-F i.e 0123456789ABCDEF).
  386.  
  387.     Binary makes use of another method of accessing memory. It accesses
  388. memory on individual bits. A bit can either be set (1) or clear (0). A byte
  389. contains 8 bits, a word contains 16 bits and a longword contains 32 bits.
  390. So as to make this easier to understand I will explain how to convert
  391. between decimal, binary and hexa-decimal. This may sound unusual but bits
  392. are referenced from the far right of the address working towards the left.
  393. The highest bit (Bit to extreme left) is called the Most Significant Bit (MSB) 
  394. and the lowest bit (Bit to extreme right) is called the Least Significant
  395. Bit (LSB).
  396.  
  397. Values for bits in a byte (8 bits)
  398. -------------------------------------------------
  399. | Bit   | 7  | 6  | 5  | 4  | 3  | 2  | 1  | 0  |
  400. | -----------------------------------------------
  401. | Value | 128| 64 | 32 | 16 | 8  | 4  | 2  | 1  |
  402. -------------------------------------------------
  403.  
  404. If you add up the value of all the bits (0-7) you will see that the total
  405. is 255 which is the maximum value which can be stored in a byte.
  406.  
  407. From the table you may have gathered that the way to convert from decimal
  408. to binary is to find out which bits added together make up the number.
  409. The easiest way of doing this is to get from the table the value of the
  410. highest bit which is less than the decimal number eg. If we wished to
  411. convert 100 to binary we would see that the nearest value we could start
  412. with was 64 (128 is too high). We then subtract 64 from the number which
  413. leaves us with 36. We then repeat the process and get the bit with the
  414. value of 32. We subtract 32 from 36 and are left with 4. We see there is a
  415. bit which is this value. This means that we have converted the number to
  416. binary. The bits we need to set are bits 6,5 and 2. Even though the bits 
  417. are accessed from the right to the left when a binary value is typed into
  418. the computer it is entered from bit 7-0 (Left to right). Therefore the
  419. binary value for 100 (Decimal) is 01100100. Here are a few more examples
  420. just to get you more used to this.
  421.  
  422.     Decimal 92 
  423.  
  424.     64+16=80
  425.     80+8=88
  426.     88+4=92
  427.  
  428.     Bits to use are 6,4,3 and 2
  429.  
  430.     Binary 92 = 01011100
  431.  
  432.  
  433.     Decimal 15 
  434.  
  435.     8+4 = 12
  436.     12+2 = 14
  437.     14+1 = 15
  438.  
  439.     Bits to use are 3,2,1 and 0
  440.  
  441.     Binary 15 = 00001111
  442.  
  443.  
  444. I hope this hasn't confused you too much. If it has don't worry
  445. about it. When I first started writing in machine code I found it
  446. confusing but once I had used it for a while it became second nature
  447. to me.
  448.  
  449.     
  450.     Values for bits in a word (16 bits)
  451.  
  452.     Bit 0 = 1
  453.     Bit 1 = 2
  454.     Bit 2 = 4
  455.     Bit 3 = 8
  456.     Bit 4 = 16
  457.     Bit 5 = 32
  458.     Bit 6 = 64
  459.     Bit 7 = 128
  460.     Bit 8 = 256
  461.     Bit 9 = 512
  462.     Bit 10 = 1024
  463.     Bit 11 = 2048
  464.     Bit 12 = 4096
  465.     Bit 13 = 8192
  466.     Bit 14 = 16384
  467.     Bit 15 = 32768
  468.  
  469. As you will probably have noticed the value for each bit is twice
  470. the value of the previous bit. Therefore it's easy to work out the extra
  471. bits required for a longword (16-31) by doing this.
  472.  
  473. I will now move on to explain how hexa-decimal fits into this. I
  474. may as well start off by telling you that it is much easier to convert a
  475. number from decimal to binary and then from binary to hexa-decimal than 
  476. it is to convert a number straight from decimal to hexa-decimal.
  477.  
  478. As previously mentioned hexa-decimal has 16 possible digits (0-F).
  479. A hexidecimal digit takes up four binary bits (Called a nibble - Half a
  480. byte). Therefore a byte can store 2 nibbles, a word can store 4 nibbles
  481. and a longword can store 8 nibbles. In case you haven't already guessed
  482. this is how you do the conversion.
  483.  
  484.     Decimal number 78 = Binary 01001110
  485.  
  486. This binary number is then split up into two nibbles
  487.  
  488.     0100 and 1110
  489.  
  490. These nibbles contain 4 bits (0-3) and the values for each bit are
  491. taken as follows
  492.  
  493.     Bit 0 = 1
  494.     Bit 1 = 2
  495.     Bit 2 = 4
  496.     Bit 3 = 8
  497.  
  498. Therefore to work out the hexa-decimal value we place the bits
  499. below the decimal values as so
  500.  
  501.     Nibble 1         Nibble 2
  502.  
  503.     8 4 2 1          8 4 2 1
  504.  
  505.     0 1 0 0          1 1 1 0
  506.  
  507.  
  508. The value of the first nibble is 4 and the value for the second is
  509. 7.  This means that Decimal 78 = Hexa-Decimal 47.
  510.  
  511. In this case we required only two nibbles (two hex digits) because
  512. the number fitted inside a byte. If the decimal number was higher than
  513. 255 and lower than 65536 it would have been stored in a word (4 nibbles)
  514. and if the value was 65536 or greater it would have been stored in a
  515. Longword (8 nibbles).
  516.  
  517. I hope this section has been understandable. If not keep going through
  518. it and hopefully you will pick it up and start to find it easy.
  519.  
  520.  
  521. Memory layout of the level bank
  522. ===============================
  523.  
  524. If you don't know any of the fundamentals of assembly language programming
  525. I strongly recommend that you read the previous section to understand fully
  526. the following information.
  527.  
  528. --- Level Header Chunk ---
  529.  
  530. Longword - "LEV"
  531. Longword - Size of chunk (Bytes)
  532. Longword - Size of whole level (Bytes)
  533. Longword - Offset of colour palette chunk from start of bank
  534. Longword - Offset of map data chunk from start of bank
  535. Longword - Offset of block data chunk from start of bank
  536. Word - World No.
  537. Word - Level No.
  538. 20 Bytes - AscII string for world name
  539. 20 Bytes - AscII string for level name
  540.  
  541. --- Palette Data Chunk ---
  542.  
  543. Longword - "PAL"
  544. Longword - Size of chunk (Bytes)
  545. Word - No. of bitplanes for level
  546. Word - Palette type (0 - Normal, 1 - AGA (Not supported))
  547. Longword - Offset for copper structure 
  548. ? Words - Colour palette data
  549.  
  550. -- Copper Structure (Not currently implemented but space is reserved)
  551. Word - Copper type (0 - Normal, 1 - AGA (Not supported))
  552. Word - Colour number to use for copper (0-255)
  553. Map-Height*16 words - line colour
  554.  
  555. --- Map data chunk ---
  556.  
  557. Longword - "MAP"
  558. Longword - Size of chunk (Bytes)
  559. Longword - Map width (Blocks)
  560. Longword - Map height (Blocks)
  561. ? Bytes - Map data ((Map-Width*2)*Map-Height) ¹
  562.  
  563. --- Block data chunk ---
  564.  
  565. Longword - "BGFX" 
  566. Longword - Size of chunk (Bytes)
  567. Word - No. of blocks (Maximum)
  568. Longword - Offset for mask data (Collision masks for blocks)
  569. ? Bytes - Block data (Gfx) ²
  570. ? Bytes - Block data (Masks) ³
  571.  
  572.  
  573. ¹ Each block in the map is stored as a number of word size
  574. ² Block data is stored in a special format called raw-blit/interleaved
  575.   format. Each block is 16 pixels x 16 pixels and stored in the following
  576.   way:
  577.  
  578.     Word 1 - Line 1 (Bitplane 0)
  579.     Word 2 - Line 1 (Bitplane 1)
  580.     Word 3 - Line 1 (Bitplane 2)
  581.     Word 4 - Line 1 (Bitplane 3)
  582.     Word 5 - Line 1 (Bitplane 4)
  583.  
  584.     Word 6 - Line 2 (Bitplane 0)
  585.     Word 7 - Line 2 (Bitplane 1)
  586.     Word 8 - Line 2 (Bitplane 2)
  587.     .... etc ....
  588.  
  589.  This format is the best way to store graphics for use with the Amigas
  590.  blitter chip as it allows the blitter to draw the block quicker. All
  591.  blocks are stored in sequential order (Block 0,1,2,3,4 etc).
  592.  
  593. ³ A mask is combination of all the bitplanes of a block and therefore
  594.   contains all the pixels set in a block. There is space for a mask for
  595.   each block in the set but actual data will only be stored here if you
  596.   have specifically generated a mask for a block in the block editor and
  597.   then stored the block again using either the insert or replace functions.
  598.   The purpose of a mask is so that you can see which areas of a block are
  599.   detected as a collision. If you don't know how to detect collisions in
  600.   this way then this feature won't be of much use to you.
  601.  
  602.  
  603. Further explanation of status bits
  604. ==================================
  605.  
  606. As previously stated I decided to use a word to store each block number in the
  607. map. If you are with me you will see that a word has 65536 values (0-65535) and 
  608. 16 bits (0-15). Therefore the number of blocks available for use with the map 
  609. are 65536. I decided that I was unlikely to use that many blocks and so what
  610. I did was to allow for the 7 high bits of the word to be used for status
  611. bits (Bits 15-9). Therefore I implemented a function which produced the
  612. following actions:
  613.  
  614.     Key-Press      Bit set
  615.  
  616.     1              15
  617.     2              14
  618.     3              13
  619.     4              12
  620.     5              11
  621.     6              10
  622.     7              9
  623.  
  624. If all 7 of these bits were to be used as status bits that would mean 
  625. that the max number of blocks available would be 512 (0-511). Here is a
  626. table so you can work out how many blocks will be available depending on
  627. the number of status bits you will be using:
  628.  
  629.     Max number of blocks    No. of status bits
  630.  
  631.     512                     7
  632.     1024                    6
  633.     2048                    5
  634.     4096                    4
  635.     8192                    3
  636.     16384                   2
  637.     32768                   1
  638.     65536                   0
  639.  
  640. The status bits are then masked out (Cleared) to get the correct block
  641. number from the word. Individual functions in the game can then be assigned
  642. to the bits which are free. This way you can make each of the bits perform
  643. a different kind of function depending on the players position in the level
  644. eg. Bit 15 could be used to tell your routines that this block cannot be
  645. walked through because there is a collision zone on that block etc. In the
  646. documentation I was providing some example uses for the bits and by no
  647. means do you have to abide by these. It depends totally on how you make use
  648. of the bits within your routines. 
  649.  
  650. Therefore to find out if any status bits are set on a map position.
  651. Retrieve the relevant word from the map data into a variable (To see how to do
  652. this you will need to refer to the Source-Code) and then mask out (Clear) the 
  653. bits which relate to the block number in the variable and then use the
  654. bit-test instruction (Explained in the Amos manual) to see whether certain
  655. status bits are set or not.
  656.  
  657. If you wish to ignore the status bits and just display the block then clear
  658. all the status bits.
  659.  
  660. If you are still unsure about the use or purpose of this function then
  661. please don't hesitate to phone me on (0722) 326057 or write to me.  At
  662. the end of the day though, this is just a minor function within the map
  663. editor intended to make life easier. It isn't essential to understand what
  664. it is for.
  665.  
  666.     
  667. -----------------------
  668. -- Other information --
  669. -----------------------
  670.  
  671. You can contact the following address if you want to know more about the
  672. program or if you wish to speak to me about anything related to AMOS or
  673. assembly language (I will try to help you with problems you may have) or
  674. suggest anything to include in updates.
  675.  
  676.  
  677. The address is:
  678.  
  679.                           11 MACKLIN ROAD
  680.                           SALISBURY
  681.                           WILTSHIRE
  682.                           SP2 7HB
  683.               ENGLAND
  684.  
  685.                           TEL. (0722) 326057
  686.  
  687. ----------------
  688. -- Final note --
  689. ----------------
  690.  
  691. I hope that you enjoy using this program and that it proves to be
  692. beneficial to you.  - Clive Minnican (Programmer).
  693.  
  694.  
  695. This program is copyright (c) 1993.
  696.  
  697.  
  698.                   -------------XXXXXXXX-------------
  699.  
  700.